﻿using UnityEngine;
using System.Collections;

public class LoadingActiveManager : ObjectBase {

    static public LoadingActiveManager Instance
    {
        get 
        {
            if (m_Instance == null)
                Create();
            return m_Instance;
        }
        set { m_Instance = value; }
    }

    static LoadingActiveManager m_Instance;

    static void Create()
    {
        GameObject tempObj = ResourceLoader.Load("Prefab/LoadingActivity/LoadingActivity") as GameObject;
        tempObj = Instantiate(tempObj) as GameObject;
        tempObj.name = "Activity";
        DontDestroyOnLoad(tempObj);

        m_Instance = tempObj.GetComponent("LoadingActiveManager") as LoadingActiveManager;
        m_Instance.transform.localPosition = new Vector3(-2000, -2000, 0);
    }

    static public void Activity(bool isOn)
    {
        Instance.gameObject.SetActive(isOn);
    }
}
